<#include "../../ajaxPage.ftl" />
<#include "../../display.ftl" />
<table class="table table-datatable table-gray ">
    <input type="hidden" id="selectUserId" name="loginName"/>
    <input type="hidden" id="selectUserName" name="userName"/>
    <thead>
    <tr>
        <th>登录名称</th>
        <th>用户名称</th>
        <th>用户状态</th>
        <th>用户类型</th>
    </tr>
    </thead>
    <tbody>
    <#if usersTable.rows??>
        <#list usersTable.rows as user>
        <tr>
            <td>${user.loginName!''}</td>
            <td>${user.userName!''}</td>
            <td>
                <@display list=userStatusList value="${user.status!''}"/>
            </td>
            <td>
                <@display list=userTypeList value="${user.userType!''}"/>
            </td>
        </tr>
        </#list>
    </#if>
    </tbody>
</table>
<#if usersTable??>
    <@page table=usersTable formId="search_user_select" contentId="selectContent"/>
</#if>
<script>
    $(function () {
        $("table tbody tr").click(function () {
            $("table tbody tr").removeClass("active");
            $(this).addClass("active");
            var loginName = $(this).children("td:eq(0)").text();
            var userName = $(this).children("td:eq(1)").text();
            if (userName != "" && loginName != "") {
                $("#selectUserId").val(loginName);
                $("#selectUserName").val(userName);
            }
        });
    });
</script>